//---------------------------------------------------------------------------
// CSyncSignal Class
// Author : Woo-Hyun Kim
// Email : woorung@nhncorp.com
// Date : Apr. 7, 2008
//---------------------------------------------------------------------------
#ifndef CSyncSignalH
#define CSyncSignalH

#include <iostream>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h> 
#include <errno.h>

#include "CSignal.h"

using namespace std;
//---------------------------------------------------------------------------
class CSyncSignal {
protected :
	int sig_send(pid_t pid, int send_signo);
	pid_t sig_wait(int receive_signo);
	pid_t sig_wait(int receive_signo, const struct timespec *timeout);

public :
	CSyncSignal();
	virtual ~CSyncSignal();

	pid_t send_and_wait(pid_t pid, int send_signo, int receive_signo);
	int wait_and_send(int receive_signo, int send_signo);
	int just_send(pid_t pid, int send_signo);
	pid_t just_wait(int receive_signo);
};
//---------------------------------------------------------------------------
#endif
